import Vue from 'vue'
import Router from 'vue-router'

import Login from '../views/Login.vue'
import Home from '../views/Home.vue'

import ListArticle from '../views/aricle/ListArticle.vue'
import PublishArticle from '../views/aricle/PublishArticle.vue'
import CommonUser from '../views/user/CommonUser.vue'
import Admin from '../views/user/Admin.vue'
import CategoryManage from '../views/category/CategoryManage.vue'
import LogManage from '../views/log/LogManage.vue'
import DataManage from '../views/data/DataManage.vue'

Vue.use(Router)

export default new Router({
	routes: [{
			path: '/',
			name: '/Login',
			component: Login,
			hidden: true
		},
		{
			path: '/Home',
			name: '/Home',
			component: Home,
			hidden: true
		},
		{
			path: '/Home',
			name: '/Home',
			component: Home,
			meta: {
				hasChild: true,
				title: '文章管理',
				icon: 'fa fa-book'
			},
			children: [{
					path: '/ListArticle',
					name: '/ListArticle',
					component: ListArticle,
					meta: {
						title: '文章列表'
					}
				},
				{
					path: '/PublishArticle',
					name: '/PublishArticle',
					component: PublishArticle,
					meta: {
						title: '文章发布'
					}
				}
			]
		},
		{
			path: '/Home',
			name: '/Home',
			component: Home,
			meta: {
				hasChild: true,
				title: '用户管理',
				icon: 'fa fa-user-circle-o'
			},
			children: [{
					path: '/CommonUser',
					name: '/CommonUser',
					component: CommonUser,
					meta: {
						title: '普通用户管理'
					}
				},
				{
					path: '/Admin',
					name: '/Admin',
					component: Admin,
					meta: {
						title: '操作员管理'
					}
				}
			]
		},
		{
			path: '/Home',
			name: '/Home',
			component: Home,
			meta: {
				hasChild: false
			},
			children: [{
					path: '/CategoryManage',
					name: '/CategoryManage',
					component: CategoryManage,
					meta: {
						title: '类别管理',
						icon: 'fa fa-reorder'
					}
				},
				{
					path: '/LogManage',
					name: '/LogManage',
					component: LogManage,
					meta: {
						title: '日志管理',
						icon: 'fa fa-file-text-o'
					}
				},
				{
					path: '/DataManage',
					name: '/DataManage',
					component: DataManage,
					meta: {
						title: '数据统计',
						icon: 'fa fa-bar-chart-o'
					}
				}
			]
		}
	]
})
